<?php

namespace App\Admin\Actions\Grid\Customer;

use App\Admin\Forms\Customer\RegisterForm;
use Dcat\Admin\Grid\RowAction;
use Dcat\Admin\Widgets\Modal;

class Register extends RowAction
{
    protected $title = '挂号信息';

    public function render(): string|Modal
    {
        // 实例化表单类并传递自定义参数
        $form = RegisterForm::make()->payload([
            'id' => $this->getKey(),
        ]);

        return Modal::make()
            ->lg()
            ->title($this->title)
            ->body($form)
            ->button('<a href="javascript:void(0)"><i class="fa fa-stethoscope"> ' . $this->title . '</i></a>');
    }
}
